package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.service.IWorkerCertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * TODO
 *
 * @Author mr.zhao
 * @Date 2025/7/1 18:05
 */
@RestController("workerCertificationAuditController")
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端 - 提交认证相关接口")
public class WorkerCertificationAuditController {

	@Autowired
	private IWorkerCertificationService workerCertificationService;

	@PostMapping
	@ApiOperation("提交认证申请")
	public void addCertification(@RequestBody WorkerCertificationAuditAddReqDTO dto){
		workerCertificationService.addCertification(dto);
	}

	@GetMapping("/rejectReason")
	@ApiOperation("查询最新的驳回原因")
	public Map<String,Object> getRejectReason(){
		String reject = workerCertificationService.getRejectReason();
		Map<String,Object> map = new HashMap<>();
		map.put("rejectReason",reject);
		return map;
	}
}
